package com.ybfenpan.job;


import com.ybfenpan.model.ParamWage;
import com.ybfenpan.service.ParamWageService;
import com.ybfenpan.service.WageCurrentService;
import com.ybfenpan.utils.Param;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;
import java.util.Calendar;
import java.util.Date;


public class WageJob {

    @Resource
    private WageCurrentService wageCurrentService;

    //晚上十二点汇总
    @Scheduled(cron = "0 0 1 * * ?")
    void wageCount() throws Exception {
        System.out.println("**************晚上汇总---开始**************");
        if (Param.hui) {
            Param.hui = false;
            wageCurrentService.saveWageCount();
            Param.hui = true;
        }
        System.out.println("**************晚上汇总---结束**************");
    }

    public WageCurrentService getWageCurrentService() {
        return wageCurrentService;
    }

    public void setWageCurrentService(WageCurrentService wageCurrentService) {
        this.wageCurrentService = wageCurrentService;
    }

}
